/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.dlsu.pdfgen.gui;

import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JButton;
import javax.swing.JFrame;

/**
 *
 * @author CoFamily
 */
public class InstructionWindow extends JFrame implements WindowListener{

    /**
     * Creates new form InstructionWindow
     */
	
    public InstructionWindow() {
        initComponents();
        setVisible(true);
		addWindowListener(this);
		setLocationRelativeTo(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextArea2 = new javax.swing.JTextArea();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTextArea3 = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Instructions");
		setResizable(false);

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jTextArea1.setEditable(false);
        jTextArea1.setText("Steps:\n1. Click Options\n2. Choose \"Create New XML\"\n3. Fill up the details under each tab\n4. Click Save\n");
        jScrollPane1.setViewportView(jTextArea1);

        jTabbedPane1.addTab("Creating New XML", jScrollPane1);

        jTextArea2.setColumns(20);
        jTextArea2.setRows(5);
        jTextArea2.setEditable(false);
        jTextArea2.setText("Steps:\n1. Browse for and select the Source XML \n   file you saved.\n2. Browse and select the destination \n   where the PDF file will be saved.\n3. Input \"Output File Name\"\n4. Click \"Generate PDF\"\n5. You may also select \"Preview\" to\n   preview the generated PDF file, a\n   temporary PDF file will be generated");
        jScrollPane2.setViewportView(jTextArea2);

        jTabbedPane1.addTab("Generating the PDF", jScrollPane2);

        jTextArea3.setColumns(20);
        jTextArea3.setRows(5);
        jTextArea3.setEditable(false);
        jTextArea3.setText("Possible reasons why errors appear when \n\"Generate PDF\" is clicked:\n1. No Source File is selected\n2. No Destination is selected\n3. The selected XML File is in an invalid\n   format\n");
        jScrollPane3.setViewportView(jTextArea3);

        jTabbedPane1.addTab("Errors", jScrollPane3);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(31, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
                .addContainerGap())
        );
        

        pack();
    }// </editor-fold>//GEN-END:initComponents


    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextArea jTextArea2;
    private javax.swing.JTextArea jTextArea3;
    // End of variables declaration//GEN-END:variables
	@Override
	public void windowActivated(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowClosed(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowClosing(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowDeactivated(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowDeiconified(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowIconified(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowOpened(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}
}
